package com.fenqing.leetcode.code.t1700_1800;

import com.fenqing.annotations.Execute;
import com.fenqing.core.Topic;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author fenqing
 */
public class Topic1769 extends Topic {

    @Execute
    public int[] minOperations(String boxes) {
        char[] chars = boxes.toCharArray();
        int[] result = new int[chars.length];
        List<Thread> threads = new ArrayList<>();
        for (int i = 0; i < chars.length; i++) {
            for (int j = 0; j < chars.length; j++) {
                if (i == j) {
                    continue;
                }
                if (chars[j] == '1') {
                    result[i] += Math.abs(i - j);
                }
            }
        }

        return result;
    }

    public static void main(String[] args) {
        Topic1769 topic1769 = new Topic1769();
        int[] arr = topic1769.run("001011");
        System.out.println(Arrays.toString(arr));
    }
}
